const {imgUrl} = getApp().globalData
import { tenderApi } from "@/utils/request/api/tender"
Page({
  data: {
    imgUrl: imgUrl + 'tender/',
    detail: {}
  },
  dealTime(str) {
    let date = new Date(str);
    let year = date.getFullYear();
    let m = date.getMonth() + 1;
    m = m < 10 ? "0" + m : m;
    let d = date.getDate();
    d = d < 10? "0" + d : d;
    return year + "-" + m + "-" + d;
  },
  onLoad(options) {
    this.setData({id: options.id})
    tenderApi.getCompanyDetail({id: options.id}).then(res => {
      let arr = res.data.map(item => {
        item.updated_at = this.dealTime(item.updated_at)
        return item
      })
      this.setData({
        detail: arr
      })
    })
  },
});